
/**
* Action class used for undo / redo
*
*/

function Action(action)
{
	
	this.action = action;
	
	this.id = null;
	
	
	// Contains previous data of the shape id
	
	// Move properties
	this.previousRealX = 0;
	this.previousRealY = 0;
	
	this.nextRealX = 0;
	this.nextRealY = 0;
	
	this.shape = null;
	
	
	
	this.recordInitialState = function(id, shape){
		this.id = id;
		switch (this.action){
			case DRAW_ACTION:
				/* Nothing to do here */
				break;
			case MOVE_ACTION:
				// Storing coords
				this.previousRealX = shape.getRealX();
				this.previousRealY = shape.getRealY();
				break;
			case DELETE_ACTION:
				//this.shape = new Shape(shape.getColor(), shape.getThickness());
				break;
			default: break;
		};
	}
	
	this.recordFinalState = function(shape){

		switch (this.action){
			case DRAW_ACTION:
				/* Nothing to do here */
				break;
			case MOVE_ACTION:
				// Storing coords
				this.nextRealX = shape.getRealX();
				this.nextRealY = shape.getRealY();
				break;
			default: break;
		};
	}
}